package study2018.com.xtianzhuang.www.designPattern.factoryPattern;

public class FactoryPatternDemo {
	public static void main(String[] args) {
		ShapeFactory shapeFactory = new ShapeFactory();
		// 获取Circle的对象 调用draw方法
		Shape shape1 = shapeFactory.getShape("CIRCLE");
		shape1.draw();

		Square square = (Square) ShapeFactory.getClass(Square.class);
		square.draw();
	}
}
